<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            padding-bottom: 800px;
        }
        .box{
            width: 800px;
            margin: 0 auto;
        }
        .box .title{
            text-align: center;
        }
        .step-box{
            position: relative;
            width: 100%;
            /* height: 60px; */
            /* background-color: bisque; */
            margin-bottom: 30px;
        }
        .step-box .step{
            position: relative;
            display: flex;
            flex-flow: row nowrap;
            justify-content: space-between;
        }
        .step-box .step .info{
            background-color: white;
            padding: 8px;
            font-size: 18px;
        }
        .step-box .step .info span:first-child{
            display: inline-block;
            width: 26px;
            height: 26px;
            text-align: center;
            line-height: 26px;
            background-color: #dedede;
            border-radius: 50%;
            margin-right: 10px;
        }
        .step-box .line{
            position: absolute;
            top: 50%;
            left: 0px;
            border: none;
            width: 100%;
            max-width: 100%;
            height: 4px;
            transform: translate(0,-2px);
            background-color: #dedede;
        }
        .step-box .line.active{
            background-color: green;
            width: 0%;
        }
        .step-box .info.active{
            color: green;
        }
        .step-box .info.active span:first-child{
            background-color: green;
            color: white;
        }
        .plane{
            width: 100%;
            height: 500px;
            box-shadow: 0 0 8px #999;
        }
    </style>
</head>
<body>
    <div id="app">

        <div class="box">
            <h4 class="title">用户注册</h4>
            <div class="step-box">
                <div class="line"></div>
                <div class="line active" :style=" `width:${ 35*step }%` "></div>
                <div class="step">
                    <div class="info" :class=" { active:step>=1 } ">
                        <span>1</span>
                        <span>账号密码</span>
                    </div>
                    <div class="info" :class=" { active:step>=2 } ">
                        <span>2</span>
                        <span>手机绑定</span>
                    </div>
                    <div class="info" :class=" { active:step>=3 } ">
                        <span>3</span>
                        <span>邮箱绑定</span>
                    </div>
                    <div class="info" :class=" { active:step>=4 } ">
                        <span>4</span>
                        <span>注册完成</span>
                    </div>
                </div>
            </div>
            <div class="plane" :style=" step==1?'display:block':'display:none' ">
                第一个
                <input type="text">
                <input type="button" value="下一步" @click="step=2">
            </div>
            <div class="plane" :style=" step==2?'display:block':'display:none' ">
                第二个
                <input type="text">
                <input type="button" value="上一步" @click="step=1">
                <input type="button" value="下一步" @click="step=3">
            </div>
            <div class="plane" :style=" step==3?'display:block':'display:none' ">
                第三个
                <input type="button" value="上一步" @click="step=2">
                <input type="button" value="下一步" @click="step=4">
            </div>
            <div class="plane" :style=" step==4?'display:block':'display:none' ">
                第四个
                <input type="button" value="上一步" @click="step=3">
                <input type="button" value="注册用户">
            </div>
        </div>

    </div>
    <script type="module"> 
        import { createApp } from "../assets/vue3/vue.esm-browser.js";
        createApp({
            data(){
                return {
                    step:1
                }
            }
        }).mount("#app")
    </script>
</body>
</html>